<?php
namespace App\Http\Controllers\Web;
use App\Http\Controllers\WebApi\BaseController as BaseController;//引用继承都基础控制器，zwp
use Illuminate\Http\Request;

class RegisterController extends BaseController{
    /** zwp
     * 打开注册新用户view页面
     * @param Request $request
     * @param string $uid
     */
    public function register(Request $request,$uid="noval"){
        $uid = $request->session()->get("uid");
        $token = $request->session()->get("token");
        if(null==$uid){
            $uid = "noval";
            $token = "noval";
        }
        $data = ["uid"=>$uid,"token"=>$token];
        return view("web.register.register",$data);
    }
    
    /** zwp
     * 打开主体信息设置view页面
     * @param string $token //注册后生成的token
     */
    public function mainInfo($token="noval"){
        $data = ["token"=>$token];
        
        return view("web.register.maininfo",$data);
    }
    
    public function login(){
        return view("web.login.login");
    }

        /**
     * 测试方法，程序中无用 zwp
     * @param Request $request
     */
    public function testSession(Request $request){
        $uid = $request->session()->get('uid');
        $token = $request->session()->get('token');
        var_dump($uid);
        var_dump($token);
        //$request->session()->forget("uid");
        //$request->session()->forget("token");
        $request->session()->forget("loginUser");
        var_dump(date("Ymd")."000000");
        $start = strtotime(date('Ymd').'000000');
        var_dump($start);
        var_dump(date("Ymd"."235959"));
        $end = strtotime(date('Ymd').'235959');
        var_dump($end);
        $var = 0.1+0.2;
        var_dump("var:".$var);
    }
}
